{{ define "layout"}}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <meta http-equiv="x-ua-compatible" content="ie=edge" />
  <title>博客</title>

  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css" />
  <!-- Google Fonts Roboto -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" />
  <!-- MDB ESSENTIAL -->
  <link rel="stylesheet" href="/css/mdb.min.css" />
  <!-- MDB PLUGINS -->
  <link rel="stylesheet" href="/css/all.min.css" />
  <!-- Your custom styles (optional) -->
  <link rel="stylesheet" href="/css/style.css">
  
</head>

<body>
    <!-- 导航栏 -->
<nav class="navbar navbar-expand-lg navbar-light bg-white fixed-top">
    <!-- Container wrapper -->
    <div class="container-fluid">
      <!-- Toggle button -->
      <button
        class="navbar-toggler"
        type="button"
        data-mdb-toggle="collapse"
        data-mdb-target="#navbarSupportedContent"
        aria-controls="navbarSupportedContent"
        aria-expanded="false"
        aria-label="Toggle navigation"
      >
        <i class="fas fa-bars"></i>
      </button>
  
      <!-- Collapsible wrapper -->
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <!-- Navbar brand -->
        <a class="navbar-brand mt-2 mt-lg-0" href="#">
        莱茵博客
        </a>
        <!-- Left links -->
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
          <li class="nav-item">
            <a class="nav-link" href="/index">首页</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">排行榜</a>
          </li>
         <li class="nav-item"> 
          <div class="input-group nav-item">
            <div class="form-outline">
              <input id="search-focus" type="search" id="form1" class="form-control" />
              <label class="form-label" for="form1">Search</label>
            </div>
            <button type="button" class="btn btn-primary">
              <i class="fas fa-search"></i>
            </button>
          </div>
         </li>  
        </ul>
        <!-- Left links -->
      </div>
      <!-- Collapsible wrapper -->
  
      <!-- Right elements -->
      <div class="d-flex align-items-center ifLoad">
        {{ if ne .U.Id 0}}
        <form action="/dengChu" method="post"><button type="submit" class="btn btn-dark px-3 me-2" action ="/dengChu">
          退出登录
        </button>
      </form>
        <img
        src="https://img2.baidu.com/it/u=989094441,1444787141&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=308"
        class="rounded-circle"
        height="40"
        loading="lazy"
      />
      {{ else }}
        <button type="button" class="btn btn-dark px-3 me-2" data-mdb-toggle="modal" data-mdb-target="#loginModel">
          登录
        </button>
        <button type="button" class="btn btn-primary me-3" data-mdb-toggle="modal" data-mdb-target="#signupModel">
          注册
         </button>
        {{ end }}
        </div>
      </div>
      <!-- Right elements -->
    </div>
    <!-- Container wrapper -->
  </nav>
  <!-- 导航栏end -->


  <!-- 内嵌的内容 -->
    {{template "content" . }}

  <!-- 内嵌的内容 end-->


    <!-- 尾部 footer -->
<footer class="bg-light text-center text-white">
    <!-- Grid container -->
    <div class="container p-4 pb-0">
      <!-- Section: Social media -->
      <section class="mb-4">
       
  
        <!-- qq -->
        <a
          class="btn text-white btn-floating m-1"
          style="background-color: #55acee;"
          href="#!"
          role="button"
          ><i class="fab fa-qq"></i>
        </a>
  
        <!-- Google -->
        <a
          class="btn text-white btn-floating m-1"
          style="background-color: #dd4b39;"
          href="#!"
          role="button"
          ><i class="fab fa-google-plus"></i
        ></a>
  
        <!-- Instagram -->
        <a
          class="btn text-white btn-floating m-1"
          style="background-color: #ac2bac;"
          href="#!"
          role="button"
          ><i class="fas fa-star-of-david"></i>
        </a>
  
        <!-- email -->
        <a
          class="btn text-white btn-floating m-1"
          style="background-color: #0082ca;"
          href="#!"
          role="button"
          ><i class="far fa-envelope"></i>
        </a>
        <!-- Github -->
        <a
          class="btn text-white btn-floating m-1"
          style="background-color: #333333;"
          href="#!"
          role="button"
          ><i class="fab fa-github"></i
        ></a>
      </section>
      <!-- Section: Social media -->
    </div>
    <!-- Grid container -->
  
    <!-- Copyright -->
    <div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
      © 2020 Copyright:
      <a class="text-white" href="#">计算2103 张诚茵</a>
    </div>
    <!-- Copyright -->
  </footer>
  <!-- 尾部结束 -->


  <!-- Modal 登陆注册 -->
<div class="modal fade" id="loginModel" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">登陆中</h5>
          <button type="button" class="btn-close" data-mdb-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body loginM">
          <form action="/login" method="post">
            <!-- id input -->
            <div class="form-outline mb-4">
              <input type="text" id="uid" class="form-control" name="userid"/>
              <label class="form-label" for="uid">id</label>
              <div class="invalid-feedback"></div>
              <div class="valid-feedback">验证通过</div>
            </div>
          
            <!-- Password input -->
            <div class="form-outline mb-4">
              <input type="password" id="Loginpassword" class="form-control" name="Lpassword"/>
              <label class="form-label" for="Loginpassword">密码</label>
              <div class="invalid-feedback"></div>
              <div class="valid-feedback">验证通过</div>
            </div>
          
            <!-- 2 column grid layout for inline styling -->
            <div class="row mb-4">
              <div class="col d-flex justify-content-center">
                <!-- Checkbox -->
                <div class="form-check">
                  <input class="form-check-input" type="checkbox" value="" id="RememberMe" checked />
                  <label class="form-check-label" for="RememberMe"> 记住我 </label>
                </div>
              </div>
          
              <div class="col">
                <!-- Simple link -->
                <a href="#!">忘记密码?</a>
              </div>
            </div>
          
            <!-- Submit button -->
            <button type="submit" class="btn btn-primary btn-block">登录</button>
          </form>
        </div>
      </div>
    </div>
  </div>
  
  <div class="modal fade" id="signupModel" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">注册中</h5>
          <button type="button" class="btn-close" data-mdb-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body signUpM">
    <form action="/signUp" method="post">
  
            <div class="form-outline mb-4 ">
              <input type="text" id="Rname" class="form-control" name="Rusername"/>
              <label class="form-label" for="Rname">昵称</label>
              <div class="invalid-feedback"></div>
              <div class="valid-feedback">验证通过</div>
            </div>
  
            <!-- Email input -->
            <div class="form-outline mb-4">
              <input type="email" id="Remail" class="form-control" name="Remail"/>
              <label class="form-label" for="Remail">邮箱</label>
              <div class="invalid-feedback">请输入一个正确的邮箱地址</div>
              <div class="valid-feedback">验证通过</div>
            </div>
          
            <!-- Password input -->
            <div class="form-outline mb-4">
              <input type="password" id="Rps" class="form-control " />
              <label class="form-label" for="Rps">密码</label>
              <div class="valid-feedback">验证通过</div>
              <div class="invalid-feedback"></div>
            </div>
             
            <div class="form-outline mb-4">
              <input type="password" id="Rps2" class="form-control" name="Rps"/>
              <label class="form-label" for="Rps2">密码Again</label>
              <div class="valid-feedback">验证通过</div>
              <div class="invalid-feedback"></div>
            </div>
            <!-- 2 column grid layout for inline styling -->
          
          
            <!-- Submit button -->
            <button type="submit" class="btn btn-primary btn-block">注册</button>
          </form>
        </div>
       
      </div>
    </div>
  </div>

</body>

<!-- MDB ESSENTIAL -->
 <script type="text/javascript" src="/js/mdb.min.js"></script>
<!-- MDB PLUGINS -->
<script type="text/javascript" src="/js/all.min.js"></script>
<!-- Custom scripts -->
<script type="text/javascript" src="/js/index.js"></script>
<!-- MDB -->
<script
  type="text/javascript"
  src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.2.0/mdb.min.js"
></script>
</html>

{{ end }}